package com.yonghui.sandbox.common;

/**
 * @description: TODO
 * @author: zhangtong
 * @create: 2021-03-15 11:44
 **/
public class ResponseResultVO<T> {

    private Integer code;

    private String msg;

    private T data;

    private ResponseResultVO() {
    }

    public static ResponseResultVO success(){
        ResponseResultVO responseResultVO = new ResponseResultVO<>();
        responseResultVO.setCode(200);
        responseResultVO.setMsg("请求成功");
        return responseResultVO;
    }

    public static ResponseResultVO success(Object t){
        ResponseResultVO responseResultVO = new ResponseResultVO<>();
        responseResultVO.setCode(200);
        responseResultVO.setMsg("请求成功");
        responseResultVO.setData(t);
        return responseResultVO;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
